﻿<UserControl x:Class="View.ProjectSettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:com="clr-namespace:DotNetNuke.Translator.Common"
             mc:Ignorable="d" 
             d:DesignHeight="775" d:DesignWidth="556">
 <Grid Margin="10">
  <Grid.ColumnDefinitions>
   <ColumnDefinition Width="Auto" />
   <ColumnDefinition Width="6" />
   <ColumnDefinition Width="*" />
  </Grid.ColumnDefinitions>

  <Grid.RowDefinitions>
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="10" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="82*" />
  </Grid.RowDefinitions>

  <Label Content="DNN Location:"
         ToolTip="Root folder of your local installation of DotNetNuke."
         Target="{Binding ElementName=txtLocation}" 
         HorizontalAlignment="Right" 
         Grid.Row="0" />
  <TextBox
      Grid.Row="0" Grid.Column="2"
      x:Name="txtLocation"
      Text="{Binding Location, UpdateSourceTrigger=PropertyChanged}" />


  <Label Content="Target Locale:" 
         ToolTip="This is the locale that the editor will create resx files for/edit"
         Target="{Binding ElementName=cmbDefaultLocale}" 
         HorizontalAlignment="Right" 
         Grid.Row="2" />
  <ComboBox
    Grid.Row="2" Grid.Column="2"
    ItemsSource="{Binding AllLocales}"
    DisplayMemberPath="EnglishName"
    SelectedItem="{Binding TargetLocale}"
    x:Name="cmbDefaultLocale" />

  <Label 
      Grid.Row="4" Grid.Column="0" 
      Content="Connection Url:" 
         ToolTip="Full url to the Localization Editor service on a remote DNN installation. Use this to be able to upload/download resources from that service."
      HorizontalAlignment="Right"
      Target="{Binding ElementName=txtConnectionUrl}" 
      />
  <TextBox
      Grid.Row="4" Grid.Column="2"
      x:Name="txtConnectionUrl"
      Text="{Binding ConnectionUrl, UpdateSourceTrigger=PropertyChanged}" />

  <Label 
      Grid.Row="6" Grid.Column="0" 
      Content="Access Key:" 
         ToolTip="Your DNN username for the remote service."
      HorizontalAlignment="Right"
      Target="{Binding ElementName=txtAccessKey}" 
      />
  <TextBox
      Grid.Row="6" Grid.Column="2" 
      x:Name="txtAccessKey"
      Text="{Binding AccessKey, UpdateSourceTrigger=PropertyChanged}" />

  <Label 
      Grid.Row="8" Content="Get Locales:" 
         ToolTip="This will attempt to connect to the remote service and check to see which locales you have access to"
      HorizontalAlignment="Right"
      />
  <Button
      Grid.Row="8" Grid.Column="2" 
    x:Name="btmTest"
    Content="Connect"
    Command="{Binding TestConnectionCommand}"
    />

  <Label 
      Grid.Row="10" Content="Mapped Locale:" 
         ToolTip="The locale you will be maping your translation to in this project. You can map specific cultures to generic cultures (e.g. es-ES to es) if you are granted access on that target locale."
      HorizontalAlignment="Right"
      Target="{Binding ElementName=cmbMappedLocale}" 
      />
  <TextBox
      Grid.Row="10" Grid.Column="2" 
      x:Name="txtMappedLocale"
      IsEnabled="False"
      Text="{Binding MappedLocale}" />

  <Label 
      Grid.Row="12" Content="Override Default Manifest Settings:" 
         ToolTip="If selected the manifests of the language packs you'll produce in this project will contain these items."
      HorizontalAlignment="Right"
      Target="{Binding ElementName=chkOverrideOwner}" 
      />
  <CheckBox
    Grid.Row="12" Grid.Column="2"
    x:Name="chkOverrideOwner"
    IsChecked="{Binding OverrideOwner, UpdateSourceTrigger=PropertyChanged}" />

  <Label 
      Grid.Row="14" Content="Owner Name:" 
      HorizontalAlignment="Right"
      Target="{Binding ElementName=txtOwnerName}" 
      />
  <TextBox
      Grid.Row="14" Grid.Column="2" 
      x:Name="txtOwnerName"
    IsEnabled="{Binding OverrideOwner}"
      Text="{Binding OwnerName, UpdateSourceTrigger=PropertyChanged}" />

  <Label 
      Grid.Row="16" Content="Owner Organization:" 
      HorizontalAlignment="Right"
      Target="{Binding ElementName=txtOwnerOrganization}" 
      />
  <TextBox
      Grid.Row="16" Grid.Column="2" 
      x:Name="txtOwnerOrganization"
    IsEnabled="{Binding OverrideOwner}"
      Text="{Binding OwnerOrganization, UpdateSourceTrigger=PropertyChanged}" />

  <Label 
      Grid.Row="18" Content="Owner Url:" 
      HorizontalAlignment="Right"
      Target="{Binding ElementName=txtOwnerUrl}" 
      />
  <TextBox
      Grid.Row="18" Grid.Column="2" 
      x:Name="txtOwnerUrl"
    IsEnabled="{Binding OverrideOwner}"
      Text="{Binding OwnerUrl, UpdateSourceTrigger=PropertyChanged}" />

  <Label 
      Grid.Row="20" Content="Owner Email:" 
      HorizontalAlignment="Right"
      Target="{Binding ElementName=txtOwnerEmail}" 
      />
  <TextBox
      Grid.Row="20" Grid.Column="2" 
      x:Name="txtOwnerEmail"
    IsEnabled="{Binding OverrideOwner}"
      Text="{Binding OwnerEmail, UpdateSourceTrigger=PropertyChanged}" />

  <Label 
      Grid.Row="22" Content="License:" 
      HorizontalAlignment="Right"
      Target="{Binding ElementName=txtLicense}" 
      />
  <TextBox
      Grid.Row="22" Grid.Column="2" 
      x:Name="txtLicense"
   Height="150"
    IsEnabled="{Binding OverrideOwner}"
      Text="{Binding License, UpdateSourceTrigger=PropertyChanged}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" AutoWordSelection="True" FontFamily="Courier New" FontSize="12" AcceptsReturn="True" AcceptsTab="True" />

  <Label 
      Grid.Row="24" Content="Copyright:" 
   ToolTip="This message will be embedded in resource files generated by this tool when creating language packs"
      HorizontalAlignment="Right"
      Target="{Binding ElementName=txtCopyright}" 
      />
  <TextBox
      Grid.Row="24" Grid.Column="2" 
      x:Name="txtCopyright"
    IsEnabled="{Binding OverrideOwner}"
      Text="{Binding Copyright, UpdateSourceTrigger=PropertyChanged}" />

  <Label 
      Grid.Row="26" Content="Dictionary:" 
   ToolTip="The dictionary is a set of translations you keep for later use. Leave empty to use the default dictionary"
      HorizontalAlignment="Right"
      Target="{Binding ElementName=txtDictionary}" Grid.RowSpan="5" />
  <Grid
      Grid.Row="26" Grid.Column="2" HorizontalAlignment="Stretch" Grid.RowSpan="5">
   <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="6" />
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="6" />
    <ColumnDefinition Width="Auto" />
   </Grid.ColumnDefinitions>
   <TextBox x:Name="txtDictionary"
      Text="{Binding Dictionary, UpdateSourceTrigger=PropertyChanged}" IsEnabled="False" />
   <Button Grid.Row="0" Grid.Column="2" Content="Browse ..." HorizontalAlignment="Stretch"
           Command="{Binding BrowseCommand}"
           />
   <Button Grid.Row="0" Grid.Column="4" Content="New ..." HorizontalAlignment="Stretch"
           Command="{Binding NewCommand}"
           />
  </Grid>

 </Grid>
</UserControl>
